package com.cloud.api.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cloud.core.entity.base.BaseEntity;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Pattern;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

@Getter
@Setter
@Accessors(chain = true)
@TableName("sys_user_dept")
@Schema(name = "SysUserDept", description = "用户角色表")
public class SysUserDept extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @Schema(description = "用户ID")
    @TableId(value = "user_id", type = IdType.ASSIGN_ID)
    private String userId;
    @NotEmpty
    @Schema(description = "数据权限")
    @TableField("dept_code")
    private String deptCode;
    @NotEmpty
    @Schema(description = "角色code")
    @TableField("role_code")
    private String roleCode;

    @NotEmpty
    @Schema(description = "姓名")
    @TableField("real_name")
    private String realName;


    @Schema(description = "邮箱")
    @TableField("email")
    private String email;

    @NotEmpty
    @Pattern(regexp = "^[A-Za-z0-9]{5,20}$")
    @Schema(description = "用户名")
    @TableField("username")
    private String username;

    @NotEmpty
    @Schema(description = "手机号")
    @TableField("mobile")
    private String mobile;

    @Schema(description = "手机号")
    @TableField("mobile_dc")
    private String mobileDc;

    @TableField(exist = false)
    private int enable;
}
